package com.server.mould.business.base;

import com.project.annotation.model.base.*;
import com.server.mould.domain.reqeust.base.PageBaseRequest;
import com.server.mould.domain.reqeust.base.RequestValueBase;
import com.server.mould.domain.result.base.ResultValueBase;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface BaseCtrlInterface<T extends RequestValueBase, W extends ResultValueBase> {

    ResultBase<List<W>> Search(@RequestBody T item) throws Exception;

    ResultBase<PageResult<W>> SearchPage(@RequestBody PageBaseRequest<T> item) throws Exception;

    ResultBase<Integer> Edit(@RequestBody T item) throws Exception;

    ResultBase<Integer> Add(@RequestBody T item) throws Exception;

    ResultBase<IdResult> Create(@RequestBody T item) throws Exception;

    ResultBase<Integer> Delete(@RequestBody T item) throws Exception;

    ResultBase<VoidResult> Change(@RequestBody T item) throws Exception;

    ResultBase<List<W>> SearchInner(@RequestBody T item) throws Exception;

    ResultBase<PageResult<W>> SearchPageInner(@RequestBody PageBaseRequest<T> item) throws Exception;

    ResultBase<Integer> EditInner(@RequestBody T item) throws Exception;

    ResultBase<VoidResult> DeleteInner(@RequestBody T item) throws Exception;

}
